//
//  ImageView.m
//  Days
//
//  Created by lanou3g on 16/1/8.
//  Copyright © 2016年 dss. All rights reserved.
//

#import "ImageView.h"


@implementation ImageView

@synthesize delegate;

-(instancetype)initWithImage:(UIImage *)image{
    
    if (self = [super initWithImage:image]) {
        //用户交互
        [self setUserInteractionEnabled:YES];
        //多点触摸
        [self setMultipleTouchEnabled:YES];
        //设置边框
        self.layer.borderWidth = 2.0;
        //边框颜色
        self.layer.borderColor =[UIColor redColor].CGColor;
        
        
        
    }
    return self;
}

//点击的时候调用方法移动视图
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    if ([delegate respondsToSelector:@selector(movedectioon:)]) {
        [delegate movedectioon:self];
    }
    
    
}


@end
